/**
 * Created by zzy on 2017/8/3.
 */
import React, {Component} from 'react';
import {
    Text,
    View,
    TouchableOpacity,
    Image,
    Dimensions
} from 'react-native';
import Modal from 'react-native-modalbox';
let ScreenWidth = Dimensions.get('window').width;

export default class Share extends Component{
    render(){
        let {shareCall,info} =this.props;
        return <Modal
            style={{height:120,width:ScreenWidth,alignItems:'center',justifyContent:'center'} }
            position={"bottom"}
            ref={"modal1"}
            swipeToClose={true}
            onOpened={false}
            backButtonClose={true}
            onClosingState={this.onClosingState}>
            <View style={{alignItems:'center'}}>
                <Text>分享</Text>
                <View style={{flexDirection:'row'}}>
                    <TouchableOpacity style={{alignItems:'center'}} onPress={()=>{
                        shareCall(0,info);
                    }}>
                        <Image style={{height:45,width:45,resizeMode:'contain'}} source={require('../../asserts/shop/icon_wechat.png')}></Image>
                        <Text>微信好友</Text>
                    </TouchableOpacity>
                    <TouchableOpacity style={{marginLeft:50,alignItems:'center'}} onPress={()=>{
                        shareCall(1,info);
                    }}>
                        <Image style={{height:45,width:45,resizeMode:'contain'}} source={require('../../asserts/shop/icon_friend_circle.png')}></Image>
                        <Text>朋友圈</Text>
                    </TouchableOpacity>
                </View>

            </View>
        </Modal>
    }

    _open(){
        this.refs.modal1.open();
    }
}